#include<stdio.h>
#define MAX 50

int main(void)
{
    int n,m;
    int ints[MAX];

    scanf("%d", &n);
    for (int i = 0; i < n; i++)
    {
        scanf("%d", &ints[i]);
    }
    scanf("%d", &m);
    
    for (int i = 0; i < n; i++)
    {
        printf("%d ", ints[i]);
        if (m >= ints[i] && m <= ints[i+1])
        {
            printf("%d ", m);
        }
        
    }
    
}